<script setup>
// import { useRouter } from "vue-router";
// const router = useRouter();
// const routerChange = (n, obj) => {
//   router.push({ path: n, query: obj });
// };
import { useCounterStore } from "./store/counter";

const counter = useCounterStore();
</script>
<template>
  <h1>父组件</h1>
  <span>pinia的数据：{{ counter.count }}</span>
  <button @click="counter.increment">+</button><br />
  <br />
  <span>{{ counter.name }}</span>
  <br />
  <span>getters的数据：{{ counter.doubleCount }}</span>
  <br />
  <span>{{ counter.doublePlusOne }}</span>
  <br />
  <button @click="counter.$reset()">重置</button>
  <button @click="counter.$patch({ count: 1 })">修改state的count</button>
  <!-- <p>
    <button @click="routerChange('/one', { xd: '小滴课堂' })">打开组件1</button>
    <br />
    <button @click="routerChange('/two')">打开组件2</button> <br />
    <button @click="routerChange('/two/three')">打开组件3</button>
  </p>
  <div>
    <router-view></router-view>
  </div> -->
</template>
